home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 September / CHIP Eylül 1998.iso / Slackwar / docs / Netatalk-HOWTO < prev    next >
Text File  |  1997-02-23  |  24KB  |  449 lines

  1.                             Linux Netatalk-HOWTO
  2.                                       
  3.                       Last updated: December 22, 1997
  4.                             by Anders Brownworth
  5.                                       
  6.      _________________________________________________________________
  7.                                       
  8.      Netatalk is a program which lets your Unix box look like an
  9.      Appletalk fileserver on a LAN. This document is intended as a guide
  10.      to help the Linux system administrator set up netatalk Appletalk
  11.      services on a Linux box. Linux is a freely distributable POSIX
  12.      compliant U*ix for 386, 486, Pentium, PowerMacintosh, Sun and DEC
  13.      Alpha hardware as well as several other experimental platforms.
  14.      (SGI, etc...) Netatalk is a program which exports a piece of the
  15.      Unix filesystem via the appletalk protocol. Using Netatalk,
  16.      Macintosh computers can mount Unix volumes as if they were standard
  17.      Appletalk network drives.
  18.      
  19.      Netatalk is brought to you by our friends at The Research Systems
  20.      Unix Group, The University of Michigan. netatalk@umich.edu
  21.      
  22.      Hugh Dixon is running the UK mirror of the Netatalk-HOWTO and Horie
  23.      Seiichi is mantaining a Japanese version of this document.
  24.      
  25.      I have started a Netatalk Counter which you should fill out after
  26.      your setup is completed. With your help, we can get an idea of how
  27.      Netatalk is being used. Note: this is for non-linux installs also!
  28.      
  29.      Comments and corrections are very welcome. Someone had sent me a
  30.      diff of my pages correcting my horrible spelling, and I proceeded
  31.      to blow away my mailbox by mistake, so if you're out there, please
  32.      resend that! I If you have problems, usually a good place to post
  33.      them is to the appropriate Netatalk list.
  34.      
  35.      Want to know who's logged on a netatalk server? Try nu.
  36.        ______________________________________________________________
  37.                                       
  38.      Before you begin:
  39.      
  40.      * You might want to look at some hardware / software suggestions.
  41.      * A section specific to netatalk on SparcLinux is available.
  42.        
  43.      What you need:
  44.      
  45.      * Computer running Linux kernel 1.2.* or later installed with source
  46.        and compilers
  47.      * An ethernet card with a driver capable of multicasting (most
  48.        drivers out there do this but some drivers such as the Intel
  49.        EtherExpress don't)
  50.      * LAN with a Mac (don't really need this but then, what's the
  51.        point?)
  52.      * The Netatalk program.
  53.           + Source code for netatalk-1.3.3
  54.           + If you want to fool with the latest beta, it's
  55.             netatalk-1.4b2.tar.gz (people are seeing twice the speed with
  56.             far less CPU utilization with this beta)
  57.           + If you prefer, you can get the Netatalk binary RPM from
  58.             RedHat and skip most of the setup discussed below.
  59.           + A patch to compile netatalk 1.4b2 under RedHat 5.0 is
  60.             available.
  61.        
  62.      What you will do:
  63.      
  64.      * Get and decompress the netatalk source code.
  65.      * Follow the 1.2.* kernel guide if you are using a 1.2.* kernel.
  66.        (2.* and later kernels need no modification)
  67.      * Follow the Netatalk-1.3.3 patch guide to fix a few bugs
  68.      * Configure netatalk source code.
  69.      * Compile netatalk.
  70.      * Install netatalk.
  71.      * Compile a kernel with appletalk services.
  72.      * Configure netatalk's options.
  73.      * Start up the server.
  74.      * Mount your new volume on the Mac.
  75.      * Look at some other topics of intrest.
  76.        
  77.      (If you were wondering why I have you compile a kernel after you
  78.      install netatalk, it's because kernel 1.2.* users patch that
  79.      kernel's appletalk support during "install netatalk" with the
  80.      kinstall rule which has since been taken out of the netatalk
  81.      package as the kernel 1.3.* and higher appletalk implimentations
  82.      don't need patching.)
  83.        ______________________________________________________________
  84.                                       
  85. Get and decompress the netatalk source code
  86.  
  87.     1. Get a copy of the latest source code.
  88.     2. Put the source code where you want to unpack it
  89.     3. Decompress the source code. Type:
  90.        gzip -d netatalk-1.3.3.tar.gz
  91.     4. Unpack the distribution. Type:
  92.        tar -xvf netatalk-1.3.3.tar
  93.        
  94.        ______________________________________________________________
  95.                                       
  96. Netatalk and Kernel Specific Setup
  97.  
  98.      * Follow the 1.2.* kernel guide if you are using a 1.2.* kernel.
  99.      * Follow the Netatalk-1.3.3 patch guide to fix a few bugs.
  100.        
  101.        ______________________________________________________________
  102.                                       
  103. Configure the netatalk source code
  104.  
  105.      Note: If you want to build for the Andrew File System, there are
  106.      things you need to do before continuing. Please refer to the
  107.      README.AFS document in the source distribution.
  108.     1. Set up paths. Edit your Makefile to reflect the install path and
  109.        the man path. In Makefile, edit the line:
  110.        DESTDIR=/usr/local/atalk
  111.        to reflect where you want netatalk to install all it's files. Edit
  112.        the line:
  113.        MANDIR={DESTDIR}/man
  114.        to reflect where you want netatalk to install it's man pages. I
  115.        set my MANDIR like this:
  116.        MANDIR=/usr/local/atalk/man
  117.        (it's really saying the same thing as before)
  118.        
  119.        ______________________________________________________________
  120.                                       
  121. Compile the netatalk program
  122.  
  123.     1. In your netatalk directory, type:
  124.        make
  125.        This will make all netatalk binaries. Make sure you get through
  126.        all of the compilation without a fatal error. Fatal errors mean
  127.        things didn't compile for one reason or another. Don't just
  128.        continue. Go back and try to figure out what went wrong.
  129.        
  130.        ______________________________________________________________
  131.                                       
  132. Install the netatalk program
  133.  
  134.     1. In your netatalk directory, type:
  135.        make install
  136.        This will install netatalk in the DESTDIR which you set in the
  137.        Makefile.
  138.        
  139.      Note: make install does not install the configuration files
  140.      necessary to run netatalk.
  141.      
  142.        ______________________________________________________________
  143.                                       
  144. Compile a kernel with appletalk services
  145.  
  146.      Note: Many Linux distributions with a 2.0 kernel (such as Debian
  147.      Linux) contain precompiled appletalk support, so you may not need
  148.      to do this. Check your configuration with a make menuconfig from
  149.      the /usr/src/linux/ directory. Note: You need to have TCP/IP up and
  150.      running also on the network card you plan to use for Appletalk
  151.      because kernel Appletalk support doesn't contain all the framing
  152.      code necessary to run Appletalk alone. You should really have
  153.      experience compiling a kernel. If you don't, look through your
  154.      Kernel-HOWTO docs. (usually at /usr/doc/faq/howto/Kernel-HOWTO.gz
  155.      in Slackware Linux. Look at it with the command: zless
  156.      /usr/doc/faq/howto/Kernel-HOWTO.gz)
  157.      
  158.      
  159.     1. Goto your linux source root directory (usually /usr/src/linux)
  160.     2. Type make config (or make menuconfig, pick your poison..)
  161.     3. Answer the questions corrosponding to your setup.
  162.           + Be sure to answer yes to Configure AppleTalk DDP support? [n]
  163.           + With older kernels (pre 1.3.*), you need IEEE802.2 support.
  164.             Answer yes to Configure IPX support [n] as the IPX package
  165.             includes IEEE802.2 interface support. (later 1.3.* kernel
  166.             distributions do not require this as later 1.3.* kernel
  167.             sources include IEEE802.2 support in their appletalk)
  168.     4. Do a make dep; make clean to set up your source code for compile.
  169.     5. Make a new kernel. If you haven't done this before, consult your
  170.        Kernel-HOWTO docs. Kernels are made with differient commands
  171.        depending on what result you want. (When I compile, I use the
  172.        command make zImage.)
  173.        
  174.      Note:You can build appletalk support as a module if you like.
  175.     6. Copy your old kernel somewhere just incase the new kernel you just
  176.        compiled decides to hate you and grind to a screaching halt!
  177.     7. Install your new kernel and reboot your system on it. WARNING!! If
  178.        you messed something up, your system will not come up! Consult
  179.        your HOWTO docs for kernel installation.
  180.        
  181.        ______________________________________________________________
  182.                                       
  183. Configure the options
  184.  
  185.      Note: This document concerns itself with Appletalk file services. I
  186.      do not go into the various print options. You will notice the print
  187.      options commented out in the examples. Mike Pearson and Bill
  188.      McGonigle have prepared a page on printing.
  189.      
  190.     1. Make yourself an atalkd.conf file. In the netatalk source
  191.        directory under etc/atalkd you will find a file called
  192.        etc.atalkd.conf. Usually this file gets edited and copied to your
  193.        netatalk DESTDIR/etc (/usr/local/atalk/etc) directory and renamed
  194.        atalkd.conf. Instructions and examples on how to edit the
  195.        atalkd.conf file are available.
  196.     2. Make yourself an AppleVolumes.default and an AppleVolumes.system
  197.        file. These files tell the system which directories to offer as
  198.        Appleshare volumes. In the netatalk source directory under
  199.        etc/afpd you will find two a files called etc.AppleVolumes.default
  200.        and etc.AppleVolumes.system. Usually these files get edited and
  201.        copied to your netatalk DESTDIR/etc (/usr/local/atalk/etc)
  202.        directory and renamed AppleVolumes.default and AppleVolumes.system
  203.        respectively. Instructions and examples on how to edit these files
  204.        are available.
  205.     3. (if you were setting up the printing options, you would do so
  206.        here.)
  207.     4. Edit your /etc/services file to include the following Appletalk
  208.        services:
  209.        rtmp 1/ddp # Routing Table Maintenance Protocol
  210.        nbp 2/ddp # Name Binding Protocol
  211.        echo 4/ddp # AppleTalk Echo Protocol
  212.        zip 6/ddp # Zone Information Protocol
  213.        The /etc/services file tells your computer what service to use
  214.        when network requests go in or out.
  215.        If you are using NIS (network information system, or YP), don't
  216.        add these lines to the services file. Add them to your NIS master
  217.        machine's maps and push them.
  218.     5. In your source distribution, edit your rc.atalk script to launch
  219.        your Appletalk services. Here's what I use:
  220.        ATALKDIR="/usr/local/atalk"
  221.        echo 'Starting Appletalk fileserver...'
  222.        ${ATALKDIR}/etc/atalkd
  223.        echo -n 'atalkd'
  224.        ${ATALKDIR}/bin/nbprgstr -p 4 `hostname|sed
  225.        's/\..*$//'`:Workstation
  226.        ${ATALKDIR}/bin/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:netatalk
  227.        echo -n ' nbprgstr'
  228.        ${ATALKDIR}/etc/afpd
  229.        echo ' afpd.'
  230.        Note: It is important not to launch any of these services in the
  231.        background as their network data structures need time to stablize.
  232.     6. Set Appletalk services to automagically start when the system is
  233.        rebooted. In the source distribution directory, move the rc.atalk
  234.        file to your /etc/rc.d directory and make it executable. (chmod
  235.        755 /etc/rc.d/rc.atalk) In your /etc/rc.d directory, edit the file
  236.        rc.local to launch the rc.atalk script. Add the following line to
  237.        your rc.local:
  238.        /etc/rc.d/rc.atalk
  239.     7. In order for someone to mount the volumes you have created on your
  240.        Linux box, they need to have a valid shell account on the Linux
  241.        system. AppleShare limits passwords to 8 characters, so you want
  242.        to add users to your Linux system with 8 character or less
  243.        passwords. A valid shell account means that somthing like /bin/sh
  244.        or /bin/tcsh is at the end of that user's entry in the /etc/passwd
  245.        file. If you just pipe to /dev/null the user will not be able to
  246.        login. Root logins are prohibited by netatalk, and for good
  247.        reason. Just don't!
  248.        
  249.        ______________________________________________________________
  250.                                       
  251. Start up the server
  252.  
  253.      Assuming everything has been installed and configured correctly,
  254.      you should have no problem turning on Appletalk services.
  255.      
  256.     1. Fire up Appletalk server. In your /etc/rc.d directory, run the
  257.        script rc.atalk. Now sit back and wait a minute or so as the
  258.        system checks out the network and sets itself up. The rc.atalk
  259.        script will normally be run at system boot time.
  260.        
  261.        ______________________________________________________________
  262.                                       
  263.     
  264.      
  265. Mount your new volume on the Mac
  266.  
  267.      Now we get to have some fun!
  268.      
  269.     1. Move over to a Macintosh connected to the ethernet.
  270.     2. Go to the Chooser from the Apple Menu.
  271.        
  272.     3. Click on the little hand holding a platter. (Appleshare services)
  273.        Note: Appletalk must be active to do this. If it's not active,
  274.        click the little button Active on Restart and restart the machine.
  275.        If it still doesn't show up, the Mac may be listening to it's
  276.        LocalTalk port rather than the EtherTalk port. To fix this, go to
  277.        the Networks control pannel and click on EthetTalk, then try the
  278.        Chooser again.
  279.     4. Login to the Appleshare server using a valid username on your Unix
  280.        system. If the Unix user you logged in as doesn't have permission
  281.        to write in the exported directory, the Appleshare volume will
  282.        mount as read-only. (this is granted this user has read
  283.        privilages!) If you change directory permissions after a volume is
  284.        mounted, you will have to throw away the volume and re-mount it
  285.        for afpd to re-read the permissions. (afpd reads directory and
  286.        file permissions every time the volume gets mounted)
  287.     5. You should see your Unix workstation in the window to the right.
  288.        Double click it and it should give you the volumes you made
  289.        available in your AppleVolumes.system and AppleVolumes.default
  290.        files.
  291.     6. Click on the volumes you want to mount. (Shift click will give you
  292.        more than one)
  293.        
  294.     7. Click OK and smile with wide-eyed wonder as your Linux volumes are
  295.        now available on your Macintosh!
  296.     8. To unmount a mounted server, throw it in the trash. Don't worry,
  297.        this won't delete the volume! (slight metaphoric inaccuracy on
  298.        Apple's part ;)
  299.        
  300.        ______________________________________________________________
  301.                                       
  302. Other stuff
  303.  
  304.      * Users of RedHat 5.0 may have difficulty compiling netatalk1.4b2
  305.        without the patched source or patch from Charles Barrasso. For the
  306.        most part, it just adds several #include lines. Because RedHat
  307.        uses shadow passwords, it also defines -DSHADOWPW.
  308.      I wrote a tiny perl script called nu that gives you a list of the
  309.        users that have afpd processes up. To use it, download it from the
  310.        above link, and save it. Do a chmod +x nu to it so you can execute
  311.        it. (requires perl) Let me know if you like it.
  312.      If you are having problems, there is a tips page which I am posting
  313.        for your browsing. These tips are from users like you who have
  314.        overcome various problems the hard way so that you don't have to!
  315.        I may not have had the same problems addressed in this page, so I
  316.        can't vouch for it's integrity.
  317.      Jay Schulist has a page on Localtalk with Linux, covering a driver
  318.        he wrote called "Cops" and applicable hardware for connecting a
  319.        Localtalk network and a Linux machine. There is a patch for 2.0.30
  320.        kernels and the driver is included in the 2.1.44 and greater
  321.        kernels. There are also some notes on IP over Localtalk.
  322.      Bill McGonigle is mantaining a Netatalk page with a great
  323.        troubleshooting guide.
  324.      Rob Newberry's Linux Services for Macintosh and Windows Users
  325.      The Real Netatalk Homepage at the University of Michigan
  326.      Windows print and file services for linux with Samba
  327.      MkLinux: Linux for the PowerMac supporting netatalk 1.3.3
  328.      SparcLinux, Linux on Sun Sparc hardware.
  329.      Linux Ports from Yahoo.
  330.      A listserv has been set up for announcements and general netatalk
  331.        discussion. It's a low volume moderated list. You can subscribe by
  332.        sending mail to netatalk-admins-request@umich.edu. Submissions
  333.        should be sent to netatalk-admins@umich.edu.
  334.      A Linux specific netatalk listserv is also available. Subscribe to
  335.        it by sending mail to listserv@netspace.org with no subject and a
  336.        body which reads SUBSCRIBE LINUX-ATALK (Your Full Name). To
  337.        unsubscribe, send mail to the same place with the message text
  338.        UNSUBSCRIBE LINUX-ATALK. Posts to this listserv should be sent to
  339.        linux-atalk@netspace.org.
  340.      * A significant differience between the netatalk-1.3.3.b2 code and
  341.        the netatalk-1.3.3 code is the 1.3.3 code does not include the
  342.        kinstall option in it's make. Kinstall is used to patch appletalk
  343.        support into the 1.2.* kernel. As of kernel 1.3.*, appletalk
  344.        support is included in the kernel, so you don't need the beta.
  345.        Older 1.3.* kernels have a "broken" implimentation of appletalk,
  346.        so avoid 1.3.* kernels prior to 1.3.9.
  347.      * It has been discussed that there is possibly a multicast reading
  348.        problem with the Intel EtherExpress driver for Linux which will
  349.        make the netatalk server on that box not to show up in the
  350.        chooser. It seems the option is commented out like so in the
  351.        eexpress.c file:
  352.        set_multicast_list(struct device *dev, int num_addrs, void *addrs)
  353.        {
  354.        /* This doesn't work yet */
  355.        #if 0
  356.        short ioaddr = dev->base_addr;
  357.        ....
  358.        There has been quite a bit of words on what "This doesn't work
  359.        yet" is supposed to mean... ;)
  360.        In general I have had awefull luck with my Intel EtherExpress
  361.        cards. Personally I like to stick to a nice 3Com 509 card or
  362.        somthing like that. 3Com's 59x PCI Vortex cards are the best for
  363.        PCI based machines.
  364.      * Some people have expressed the want to use a differient icon for
  365.        the netatalk volume. One way to do this is to do a "Get Info" on
  366.        an icon you want to use. Next, select the icon in the Get Info
  367.        window. (when it's highlighted, you should see a little black box
  368.        around the icon) Do a Copy. Do a "Get Info" with the linux volume
  369.        selected. Click on the "world-on-a-platter" icon, and do a Paste.
  370.        Whalah!
  371.      * Sam Woolf passed allong a tip he found if the above method of
  372.        changing a Netatalk server icon fails. He mentions a utility from
  373.        Aladdin Systems called Rejuvenator that fixes corrupt server and
  374.        folder icons.
  375.      * For Netatalk 1.3.3, support for shadowed passwords can be achieved
  376.        by substituting this auth.c file for the origional one in
  377.        etc/afpd. Re-compile your afpd binary with the -DSHADOW_PASSWORD
  378.        option to build an afpd with shadow password support. To do this,
  379.        edit etc/afpd/Makefile and add -DSHADOW_PASSWORD to the list of
  380.        CFLAGS. The netatalk 1.4b2 package doesn't need the patch. Just
  381.        compile with -DSHADOWPW.
  382.      * An interesting point: Paul Hargrove has written hfs for linux. To
  383.        put it in a nut-shell, he made it so you can mount and have read
  384.        and limited write access to macintosh volumes on your Linux box. I
  385.        am using it to make Macintosh CD-ROMS mounted on my Linux box via
  386.        hfs, available through netatalk to my Macintosh users. Give it a
  387.        try if you are up for it. I've had good luck with it. To use hfs
  388.        with netatalk, you want to mount a disc with the fork=netatalk
  389.        option. (ie: mount -t hfs -o fork=netatalk /dev/your_cd
  390.        /where_you_want_it_mounted)
  391.      * On my linux / netatalk box, I also run a program called samba. If
  392.        you are not familiar with it, samba enables file and print
  393.        services for Windows users from Linux. (or any Unix for that
  394.        matter) I serve CD-ROMS, writeable volumes, and print services to
  395.        Windows and Macintosh users with samba, hfs and netatalk all on
  396.        one Linux system. (not to mention the web servers, proxy server,
  397.        mail and news which are also run from this little Dell 486 DX2/66!
  398.        It's the Library machine for The Stony Brook School)
  399.      * If you want to change the name of a server as it appears in the
  400.        chooser, call afpd with the -n option. I like to have the server
  401.        name capitalized, so I call afpd like this:
  402.        
  403.      afpd -n "Eyore"
  404.        making Eyore show up as the server name instead of the (all
  405.        lowercase) hostname eyore.
  406.      * Werner Eugster has prepared a printing HOWTO and Mike Pearson and
  407.        Bill McGonigle have written a printing page covering the printing
  408.        issues which I have so skillfully avoided in these pages! ;)
  409.      * Linux has been ported to the PowerMac by Apple and OSF-RI. The
  410.        result of their work is called MkLinux. I'm writing this on a
  411.        Radius 81/110 PowerMac colone running MkLinux! However, the most
  412.        interesting thing is that netatalk-1.3.3 has been ported to
  413.        MkLinux by Michel Pollet so your Mac running Linux can still run
  414.        as an AppleShare fileserver!
  415.        MkLinux runs on the Mach 3.0 microkernel, so what I would love to
  416.        see would be a port of the MacOS which would either run as a Linux
  417.        process, or just another OS on the Mach kernel! I have two
  418.        monitors on my PowerMac. MacOS could run on one screen with X on
  419.        the other. Move your mouse from X over to MacOS on the same box.
  420.        The perfect developer's environment!
  421.      * Several people have asked what I did to make my Mac interface look
  422.        "3D" as it does on the top of this page. Well, it's not me, it's
  423.        the fault of Aaron, a cool extension by Greg Landweber. (actually
  424.        now greatly enhanced in Kaleidoscope, Greg's new product) You can
  425.        freely evaluate it by downloading it and dropping it into the
  426.        extensions folder in your system folder and rebooting your Mac.
  427.      * Interested in what this page really looks like in Japanese?
  428.      * Just incase anyone hadn't noticed, I name my computers after
  429.        cartoon characters. (hence the names in the examples above) For
  430.        those of you who have asked for an explanation, other than the
  431.        obvious Calvin from Calvin and Hobbes, Thak is the name of the
  432.        cavemen with the big body and tiny head commonly appearing in Gary
  433.        Larson's The Far Side.
  434.        
  435.      [INLINE] I'm looking for a job, so if you can help, it would be
  436.      greatly appreciated.
  437.      
  438.      If this little guide has been helpfull with your installation,
  439.      please drop me a note stating so. I'd like to find out if all the
  440.      work I've put into this project has helped anyone out. If you wish
  441.      to thank me, you may do so best by asking around to see if there
  442.      are any old Silicon Graphics workstations that are unused. I would
  443.      be very interested in removing them as I'm fostering a collection
  444.      of antiquities. ;) Thanks!
  445.      
  446.        ______________________________________________________________
  447.                                       
  448.      This page mantained by Anders Brownworth. Copyright ⌐ 1997
  449.